from django.db import models
from django.db import models
from utis.basemodel import BaseModel


# Create your models here.


class Nav(BaseModel):
    name = models.CharField(max_length=50, verbose_name='名称')
    url = models.CharField(max_length=200, verbose_name='链接')
    ishttp = models.BooleanField(default=False, verbose_name='是否外链')
    position = models.IntegerField(default=1, verbose_name='位置')

    class Meta:
        db_table = 'nav'

    def __str__(self):
        return self.name


class Banner(BaseModel):
    title = models.CharField(max_length=30, verbose_name="图片名称")
    ishttp = models.BooleanField(default=False, verbose_name="是否为链接")
    imgurl = models.CharField(max_length=200, verbose_name="图片的路径")
    url = models.CharField(max_length=200, verbose_name="跳转的路径")

    class Meta:
        db_table = 'fgbanner'

    def __str__(self):
        return self.title
